home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1999 July
/
Macworld (1999-07).dmg
/
Shareware World
/
Info
/
For Developers
/
Mops 3.4.sea
/
Mops source
/
More classes
/
StringArray
< prev
next >
Wrap
Text File
|
1998-07-02
|
892b
|
53 lines
\ StringArray - MRH May 86.
\ This class adds suitable indexed methods to the class Bytestring.
\ need bytestring
:class STRINGARRAY super{ string+ array }
int CURRENT
:m CURRENT:
get: current ;m
:m (SEL): { idx -- }
idx put: current
idx ^elem4 @ ^base !
nil?: self ?EXIT
^base size: handle put: size ;m
:m SELECT: { idx -- }
idx (sel): self
nil?: self
IF \ new: not done - do it now
new: super
handle: self idx ^elem4 !
ELSE
reset: self
THEN ;m
:m NEW: ;m \ Not needed now, as select: does it if necessary.
:m RELEASE:
limit 0 DO
i (sel): self release: super \ Harmless if not open
nilH i ^elem4 !
LOOP ;m
:m CLEARALL:
limit 0 DO
i (sel): self
handle: self IF clear: super THEN
LOOP ;m
:m DUMP:
." Current:" get: current . cr
dump: super ;m
:m CLASSINIT:
idxbase limit 4* bounds
DO nilH i ! 4 +LOOP ;m
;class